<?php
$id=$_GET['id'];
$link =@mysql_connect('127.0.0.1','root','root');
if(!$link){
    die('连接失败，错误号为：'.mysql_errno().'失败原因：'.mysql_error());
}
mysql_select_db('blog');
mysql_set_charset('utf8');
$sql = "select * from `notice` where id=$id";
$res = mysql_query($sql) or mysql_error();
$arr = array();
while ($row = mysql_fetch_assoc($res)){
    $arr[] = $row;
}
// var_dump($arr);die;
$arr=$arr[0];
mysql_free_result($res);
mysql_close();
?>
<?php
require($_SERVER['DOCUMENT_ROOT'].'/admin/public/header.php');
?>

<div class="main-wrap">
        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="/admin/index.php">首页</a><span 
            class="crumb-step">&gt;</span><a class="crumb-name" href="/admin/notice/index.php">作品管理</a>
               <span class="crumb-step">&gt;</span><span>修改</span></div>
        </div>
        <div class="result-wrap">
            <div class="result-content">
                <form action="/admin/notice/xiugai.php" method="post" id="myform" name="myform" enctype="multipart/form-data">
                    <table class="insert-tab" width="100%">
                        <tbody><tr>
                            <th ><i class="require-red">*</i>分类：</th>
                            <td>
                                <select name="colId" id="catid" class="required">
                                    <option value="">请选择</option>
                                    <option value="19">精品界面</option><option value="20">推荐界面</option>
                                </select>
                            </td>
                        </tr>
                        <tr>    
                            <th>ID</th>
                            <td><input type="text" name="id" value="<?php echo $arr["id"]?>"></td>
                        </tr>
                        <tr>
                            <th>内容</th>
                            <td><textarea name="cate" class="common-textarea" id="cate" cols="30" style="width: 98%;" rows="10"><?php echo $arr["cate"]?></textarea></td>
                        </tr>
                        <tr>
                            <th>状态</th>
                            <td><input type="radio" name="status" value="0" <?php echo $arr["status"]=='0'?'checked':'' ?> >不显示
                                <input type="radio" name="status" value="1" <?php echo $arr["status"]=='1'?'checked':'' ?> >显示</td>
                        </tr>
                        <tr>
                            <th>创建时间</th>
                            <td><input type="text" name="datetime" value="<?php echo $arr["datetime"]?>"></td>
                        </tr>
                        </tbody></table>
                        <input type="submit" value="提交">
                </form>
            </div>
        </div>

<?php
require($_SERVER['DOCUMENT_ROOT'].'/admin/public/footer.php');
?>
